<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/equipment/Mass_DetectionTemplate.js此处编写
 -->
<template>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
        :editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
        :table="table" :extend="extend">
    </view-grid>
</template>
<script>
import extend from "@/extension/mass/Mass_DetectionTemplate.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
    setup() {

        // 表格数据
        const table = ref({
            key: 'Mass_DetectionTemplate_ID',
            cnName: '检测模板',
            name: 'Mass_DetectionTemplate',
            url: "/Mass_DetectionTemplate/",
            sortName: "CreateDate"
        });


        // 列表
        const columns = ref([
            { field: 'Mass_DetectionTemplate_ID', title: '检测模板主键', type: 'int', hidden: true, readonly: true, require: true, align: 'left' },
            { field: 'Mass_DetectionTemplate_Code', title: '模板编码', type: 'string', width: 200, link: true, sort: true, require: true, align: 'left', sort: true },
            { field: 'Mass_DetectionTemplate_Name', title: '模板名称', type: 'string', width: 200, sort: true, require: true, align: 'left', sort: true },
            { field: 'Mass_DetectionTemplate_Type', title: '检测种类', type: 'string', width: 180, bind: { key: 'Mass_DetectionTemplate', data: [] }, require: true, align: 'left' },
            { field: 'Mass_DetectionTemplate_IsNo', title: '模板状态', type: 'int', width: 120, bind: { key: 'enable', data: [] }, require: true, align: 'left' },
            { field: 'Mass_DetectionTemplate_Remark', title: '备注', type: 'string', width: 120, align: 'left' },

            { field: 'CreateID', title: '创建人编号', type: 'int', width: 120, hidden: true, align: 'left' },
            { field: 'Creator', title: '创建人', type: 'string', width: 120, align: 'left' },
            { field: 'CreateDate', title: '创建时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true },
            { field: 'ModifyID', title: '修改人编号', type: 'int', width: 120, hidden: true, align: 'left' },
            { field: 'Modifier', title: '修改人', type: 'string', width: 120, align: 'left' },
            { field: 'ModifyDate', title: '修改时间', type: 'datetime', sort: true, width: 150, align: 'left', sort: true }
        ]);

        // 表单字段
        const editFormFields = ref({
            "Mass_DetectionTemplate_Code": "",
            "Mass_DetectionTemplate_Name": "",
            "Mass_DetectionTemplate_Type": "",
            "Mass_DetectionTemplate_IsNo": "",
            "Mass_DetectionTemplate_Remark": ""
        });

        // 新增表单配置
        const editFormOptions = ref([
            [{ "title": "模板编码", "required": true, "field": "Mass_DetectionTemplate_Code", "type": "input", "placeholder": "编码若为空，则自动生成编码" }],
            [{ "title": "模板名称", "required": true, "field": "Mass_DetectionTemplate_Name", "type": "input" }],
            [{ "dataKey": "Mass_DetectionTemplate", "data": [], "title": "检测种类", "field": "Mass_DetectionTemplate_Type", "type": "checkbox", "required": false }],
            [{ "dataKey": "enable", "data": [], "title": "模板状态", "required": true, "field": "Mass_DetectionTemplate_IsNo", "type": "radio" }],
            [{ "title": "备注", "field": "Mass_DetectionTemplate_Remark", "type": "textarea" }]
        ]);

        // 搜索条件
        const searchFormFields = ref(
            {
                "Mass_DetectionTemplate_Name": "",
                "Mass_DetectionTemplate_Type": "",
                "Mass_DetectionTemplate_IsNo": "",
                "Mass_DetectionTemplate_Remark": ""
            }
        );

        // 高级查询条件
        const searchFormOptions = ref([
            [
                { "title": "模板名称", "field": "Mass_DetectionTemplate_Name", "type": "like" },
                { "dataKey": "Mass_DetectionTemplate", "data": [], "title": "检测种类", "field": "Mass_DetectionTemplate_Type", "type": "select" },
            ],
            [
                { "dataKey": "enable", "data": [], "title": "模板状态", "field": "Mass_DetectionTemplate_IsNo", "type": "select" },
                { "title": "备注", "field": "Mass_DetectionTemplate_Remark", "type": "like" },
            ]
        ]);


        // 详情
        const detail = ref({
            cnName: "#detailCnName",
            table: "#detailTable",
            columns: [],
            sortName: "",
            key: ""
        });

        return {
            table,
            extend,
            editFormFields,
            editFormOptions,
            searchFormFields,
            searchFormOptions,
            columns,
            detail,
        };
    },
});
</script>
